//
// Decompiled by Jadx - 448ms
//
package me.plusne.Adapter.Login;

import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import androidx.recyclerview.widget.RecyclerView;
import fg.r;
import java.util.ArrayList;
import java.util.List;
import me.plusne.common.Json.Login.JsonLoginDeviceList;
import r.g;

public final class a extends RecyclerView.h<b> {
    public final a a;
    public final ArrayList b;

    public a(List list, g gVar) {
        ArrayList arrayList = new ArrayList();
        this.b = arrayList;
        this.a = gVar;
        arrayList.addAll(list);
    }

    public final int getItemCount() {
        return this.b.size();
    }

    public final void onBindViewHolder(RecyclerView.ae aeVar, int i) {
        String str;
        String time;
        b bVar = (b) aeVar;
        JsonLoginDeviceList.DataBean dataBean = (JsonLoginDeviceList.DataBean) this.b.get(i);
        bVar.getClass();
        if (TextUtils.isEmpty(dataBean.getName())) {
            str = dataBean.getLoginName();
        } else {
            str = dataBean.getName() + "(" + dataBean.getLoginName() + ")";
        }
        bVar.a.setText(str);
        StringBuilder sb = new StringBuilder("[");
        sb.append(dataBean.getUuid());
        sb.append("] ");
        if (dataBean.getTime().equals("1970-01-01 00:00:00")) {
            time = "无登录记录";
        } else {
            time = dataBean.getTime();
        }
        sb.append(time);
        bVar.b.setText(sb.toString());
        g.v(bVar.c, -2113535894);
        ((RecyclerView.ae) bVar).itemView.setOnLongClickListener(new b(bVar, dataBean, i));
        ((RecyclerView.ae) bVar).itemView.setOnClickListener(new r(bVar, dataBean, i, 1));
    }

    public final RecyclerView.ae onCreateViewHolder(ViewGroup viewGroup, int i) {
        return new b(LayoutInflater.from(viewGroup.getContext()).inflate(-2113142703, viewGroup, false), this.a);
    }
}
